﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Agr.CQRS.Domain.Commands;

namespace Agr.Questionnaire.Core.Domain.Qnnaire.Commands
{
[Serializable]
    public class CreateEmptyQuestionnaire : Command
    {
        public string Name { get; set; }
    }

    public class CreateEmptyQuestionnaireHandler : CommandHandler<CreateEmptyQuestionnaire>
    {
        protected override void ExecuteInternal(CreateEmptyQuestionnaire command)
        {
            var q = GetById<Questionnaire>(command.AffectedAggregateRootId, 0);
            q.UseName(command.Name);
        }
    }

}
